<?php
/**
 * @Name: RoleNodeModel.php
 * @Author: yashuai<1762910894@qq.com>
 */

namespace app\common\model\rbac;

use app\common\model\BaseModel;

class RoleNodeModel extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'ID';

    /**
     * 数据表名
     * @var string
     */
    protected $table = 'db_admin_role_node';

    public function node()
    {
        return $this->hasOne(NodeModel::class, 'NodeID', 'NodeID')
            ->field(['NodeID', 'NodeType', 'ParentID']);
    }

}
